home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 16 / PC Actual CD 16.iso / autocad / R14801.DXR / 00002_mapScript.ls < prev    next >
Encoding:
Text File  |  1997-04-24  |  3.6 KB  |  89 lines

  1. property pHiliterSprite, pBackgroundSprite, pHeadingSprite, pTextListSprite, pPhoneDisplaySprite, pArrowSprite, pArrowRollSprite
  2. global gScript, gVoid
  3.  
  4. on initWorldMap
  5.   set gScript to script "mapScript"
  6.   set the pHiliterSprite of gScript to 10
  7.   set the pBackgroundSprite of gScript to 11
  8.   set the pHeadingSprite of gScript to 12
  9.   set the pTextListSprite of gScript to 13
  10.   set the pPhoneDisplaySprite of gScript to 14
  11.   set the pArrowSprite of gScript to 16
  12.   set the pArrowRollSprite of gScript to 15
  13.   set the visible of sprite the pHiliterSprite of gScript to 0
  14.   set the visible of sprite the pBackgroundSprite of gScript to 0
  15.   set the visible of sprite the pTextListSprite of gScript to 0
  16.   set the visible of sprite the pHeadingSprite of gScript to 0
  17.   set the visible of sprite the pPhoneDisplaySprite of gScript to 0
  18.   set the visible of sprite the pArrowSprite of gScript to 0
  19.   set the visible of sprite the pArrowRollSprite of gScript to 0
  20.   go("worldMap")
  21.   puppetAllSprites(1)
  22. end
  23.  
  24. on closeWorldMap
  25.   puppetAllSprites(0)
  26.   repeat with i = 1 to count(gScript)
  27.     setaProp(gScript, getPropAt(gScript, i), gVoid)
  28.   end repeat
  29.   set gScript to gVoid
  30. end
  31.  
  32. on clickedAContintent myContinentCode
  33.   set the visible of sprite the pPhoneDisplaySprite of gScript to 0
  34.   set the visible of sprite the pArrowSprite of gScript to 0
  35.   set the visible of sprite the pArrowRollSprite of gScript to 0
  36.   set the member of sprite the pHiliterSprite of gScript to member ("hmap_" & myContinentCode)
  37.   set the member of sprite the pHeadingSprite of gScript to member ("head_" & myContinentCode)
  38.   set the member of sprite the pTextListSprite of gScript to member ("phlist_" & myContinentCode)
  39.   set the visible of sprite the pHiliterSprite of gScript to 1
  40.   set the visible of sprite the pBackgroundSprite of gScript to 1
  41.   set the visible of sprite the pTextListSprite of gScript to 1
  42.   set the visible of sprite the pHeadingSprite of gScript to 1
  43.   clickedOnFieldLIne(myContinentCode, 1)
  44. end
  45.  
  46. on clickedOnFieldLIne myContinentCode, myLineNum
  47.   set tField to the member of sprite the pTextListSprite of gScript
  48.   set tLineNum to max(min(the number of lines in field tField, myLineNum), 1)
  49.   set the member of sprite the pPhoneDisplaySprite of gScript to member ("ph_" & myContinentCode & tLineNum)
  50.   set the visible of sprite the pPhoneDisplaySprite of gScript to 1
  51.   if myLineNum = 1 then
  52.     set the loc of sprite the pArrowSprite of gScript to point(562, 104)
  53.   else
  54.     set the loc of sprite the pArrowSprite of gScript to the loc of sprite the pArrowRollSprite of gScript
  55.   end if
  56.   set the visible of sprite the pArrowSprite of gScript to 1
  57. end
  58.  
  59. on rolloverField
  60.   if rollOver(the pTextListSprite of gScript) then
  61.     set tMouseLine to the mouseLine
  62.     if tMouseLine > 0 then
  63.       set tTextSprite to the pTextListSprite of gScript
  64.       set tFieldLocH to the locH of sprite tTextSprite
  65.       set tFieldLocV to the locV of sprite tTextSprite
  66.       set tLineHeight to the textHeight of member the member of sprite tTextSprite
  67.       set the locH of sprite the pArrowSprite of gScript to tFieldLocH - 2
  68.       set the locH of sprite the pArrowRollSprite of gScript to tFieldLocH - 2
  69.       set the locV of sprite 15 to tFieldLocV + (tLineHeight / 2) + (tLineHeight * (tMouseLine - 1))
  70.       set the visible of sprite the pArrowRollSprite of gScript to 1
  71.     end if
  72.   else
  73.     set the visible of sprite the pArrowRollSprite of gScript to 0
  74.   end if
  75. end
  76.  
  77. on puppetAllSprites myBoolean
  78.   repeat with i = 1 to 48
  79.     set the puppet of sprite i to myBoolean
  80.   end repeat
  81. end
  82.  
  83. on wait myWaitTicks
  84.   set tEndTicks to the ticks + myWaitTicks
  85.   repeat while tEndTicks > the ticks
  86.     nothing()
  87.   end repeat
  88. end
  89.